<template>
	<view>
		<view class="bg-light " :class="fixed?'fixed-top':''">
			<!-- 状态栏 -->
			<view :style="{'height':statusBarHeight+'px','background-color':'#000'}"></view>
			<!-- 导航 -->
			<view class="w-100 flex align-center justify-between" style="height: 90rpx;">
				<!-- 左边 -->
				<view class="flex align-center">
					<text class="font-md ml-3">{{title}}</text>
				</view>
				<!-- 右边 -->
				<view class="flex align-center">
					<free-icon-button><text class="iconfont font-md">&#xe6e3;</text></free-icon-button>
					<free-icon-button><text class="iconfont font-md">&#xe682;</text></free-icon-button>
				</view>
			</view>
		</view>
		<!-- 占位 -->
		<view v-if="fixed" :style="fixedStyle"></view>
	</view>
</template>

<script>
	import freeIconButton from '@/components/free-ui/free-icon-button.vue'
	export default {
		props: {
			title: {
				type: String,
				default: ""
			},
			fixed: {
				type: Boolean,
				default: true
			}
		},
		components: {
			freeIconButton
		},
		data() {
			return {
				statusBarHeight: 0,
				navBarHeight: 0
			}
		},
		mounted() {
			// #ifdef APP-PLUS-NVUE
			this.statusBarHeight = plus.navigator.getStatusbarHeight()
			// console.log(this.statusBarHeight)
			//#endif
			this.navBarHeight = this.statusBarHeight + uni.upx2px(90)
		},
		computed: {
			fixedStyle() {
				return `height:${this.navBarHeight}px`
			}
		}
	}
</script>

<style>
</style>
